﻿
@{
    ViewBag.Title = "Index";
    Layout = null;
}

<!DOCTYPE html>
<html lang="zh-CN">
<head>
    <meta name="viewport" content="width=device-width, initial-scale=1">
    <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1, user-scalable=no">
    <title></title>
    <link href="~/Content/admin/css/bootstrap.min.css" rel="stylesheet" />
    <script src="/Scripts/jquery-1.10.2.min.js"></script>

</head>
<body>
    <div class="container-fluid">

        @*<ol class="breadcrumb">
                <li><a href="/set/admin/center">首页></a></li>
                <li><a href="#">线下收银></a></li>
                <li class="active">会员充值</li>
            </ol>*@
        <div class="col-md-10">
            <div class="panel panel-info">
                <div class="panel-heading" style="font-size:large;">会员充值</div>
                <div class="panel-body">
                    <form class="form-horizontal" action="" method="post" role="form" id="formRecharge">
                        <div class="row">
                            <div class="col-md-3">
                                <h4 class="text-right"><strong>会员号:</strong></h4>
                            </div>
                            <div class="col-md-7">
                                <div class="input-group">
                                    <input type="text" id="MemberCard" class="form-control" placeholder="手机号/卡号">
                                    <span class="input-group-btn" onclick="ReadCard();">
                                        <button class="btn btn-primary" type="button">读卡</button>
                                    </span>
                                </div>
                            </div>
                        </div>
                        <div class="row">
                            <br /><br />
                        </div>
                        <div class="row">
                            <div class="col-md-4">
                                <dl class="dl-horizontal ">
                                    <dt>姓名:</dt>
                                    <dd id="name"></dd>
                                </dl>
                            </div>
                            <div class="col-md-4">
                                <dl class="dl-horizontal">
                                    <dt>手机号:</dt>
                                    <dd id="mobile"></dd>
                                </dl>
                            </div>
                            <div class="col-md-4">
                                <dl class="dl-horizontal">
                                    <dt>会员等级:</dt>
                                    <dd id="catName"></dd>
                                </dl>
                            </div>
                        </div>

                        <div class="row">
                            <div class="col-md-4">
                                <dl class="dl-horizontal ">
                                    <dt>余额:</dt>
                                    <dd id="value"></dd>
                                </dl>
                            </div>
                            <div class="col-md-4">
                                <dl class="dl-horizontal">
                                    <dt>积分:</dt>
                                    <dd id="point"></dd>
                                </dl>
                            </div>
                            <div class="col-md-4">
                                <dl class="dl-horizontal">
                                    <dt>注册时间:</dt>
                                    <dd id="regTime"></dd>
                                </dl>
                            </div>
                        </div>
                        <hr style="border-color: #d2a3a3;" />

                        <div class="form-group">
                            <label for="" class="col-sm-3 control-label" style="font-size:20px;">充值金额</label>
                            <div class="col-sm-5">
                                <div class="input-group">
                                    <input type="number" class="form-control input-lg" id="Value" placeholder="">
                                    <div class="input-group-addon">元</div>
                                </div>
                            </div>
                        </div>
                        <div class="form-group">
                            <label for="inputPassword3" class="col-sm-3 control-label" style="font-size:20px;">支付方式</label>
                            <div class="col-sm-5">
                                <label class="radio-inline">
                                    <input type="radio" name="PayType" value="0" checked="checked" />现金支付
                                </label>
                                <label class="radio-inline">
                                    <input type="radio" name="PayType" value="1" />银行卡支付
                                </label>
                            </div>
                        </div>
                        <div class="form-group">
                            <label for="inputPassword3" class="col-sm-3 control-label" style="font-size:20px;">备注</label>
                            <div class="col-sm-5">
                                <textarea class="form-control" rows="3"></textarea>
                            </div>
                        </div>
                        <div class="form-group">
                            <div class="col-sm-offset-3 col-sm-4">
                                <button type="submit" class="btn btn-danger btn-block"><span class="glyphicon glyphicon-yen"></span>确认充值</button>
                            </div>
                        </div>
                    </form>
                </div>
            </div>
        </div>
    </div>
    @*<script src="~/Content/layer/layer.js"></script>*@
    <script src="/Content/Validform_v5.3.2/Validform_v5.3.2_min.js"></script>
    <script type="text/javascript">
        $("#MemberCard").focus();
        function RechargeSubmit()//formRecharge
        {

        }
        function ReadCard()
        {
            if ($("#MemberCard").val().trim().length == 0)
            {
                $("#MemberCard").focus();
                return false;
            }
            $.post("/Common/Common/ReadCard", { cardId: $("#MemberCard").val().trim() }, function (data)
            {
                $("#name").html(data.Name);
                $("#mobile").html(data.Mobile);
                $("#catName").html(data.CategoryName);

                $("#value").html(data.Value);
                $("#point").html(data.Point);
                $("#regTime").html(data.RegTime);
            });
        }
        $(function ()
        {
            $("#formRecharge").Validform({
                ajaxPost: true,
                showAllError: true,
                beforeSubmit: function (curform)
                {
                    if ($("#MemberCard").val().trim().length == 0)
                    {
                        parent.layer.msg('请先读取会员!', function () { });
                        $("#MemberCard").focus();
                        return false;
                    }

                    if ($("#Value").val().trim().length == 0)
                    {
                        parent.layer.msg('请输入充值金额!', function () { });
                        $("#Value").focus();
                        return false;
                    }
                    parent.layer.msg('正在充值...', { icon: 16, offset: ['40%', '40%'] });
                    return true;
                },
                callback: function (data)
                {

                },
                tiptype: function (msg, o)
                {

                }
            }
            );
        });
    </script>
</body>
</html>
